<template>
	<view class="charts-box">
		<qiun-data-charts type="pie"  :chartData="chartData" />
	</view>
</template>

<script>
	import {
		request
	} from '@/utils/request.js'
	export default {
		data() {
			return {
				chartData: {

				}
			}
		},
		onReady() {
			// 请求统计数据
			this.getData();
		},
		methods: {
			async getData() {
				const res = await request('/api/TotalAreaCropsProportion');
				if (res.statusCode !== 200) {
					return false;
				}
				console.log(res.data);
				this.chartData = {
					series: [{
						data:res.data
					}]
				}
			}
		}
	}
</script>

<style>
	.charts-box {
		margin-top: 60rpx;
		width: 100%;
		height: 300px;
	}
</style>